package com.soft.javase.day08.linkedlist;

import java.util.LinkedList;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/28
 */
public class QueueSimulation {
    public static void main(String[] args) {
        LinkedList<Person> queue = new LinkedList<>();

        // 入队添加到队尾
        queue.addLast(new Person("张三", 25));
        queue.addLast(new Person("李四", 30));
        queue.addLast(new Person("王五", 35));

        System.out.println("入队后队列内容: " + queue);

        // 出队从队首移除
        Person removePerson = queue.removeFirst();
        System.out.println("出队元素: " + removePerson);

        System.out.println("出队后队列内容: " + queue);

        // 查看队首元素
        Person peekPerson = queue.peekFirst();
        System.out.println("队首元素: " + peekPerson);

        System.out.println("队列当前内容: " + queue);
    }
}
